package Assets.Controls
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	
	import mx.containers.Canvas;
	
	public class NewTab
	{
		//public var newTab:Panel= new Panel;
		public var newTab:Canvas = new Canvas;
		private var container_sprite:Sprite=new Sprite;
		private var children_array:Array = new Array;
		
		public function NewTab(Container:Sprite)
		{
			
			this.container_sprite= Container;
			//this.children_array = infoObj_object.children;
			//this.newTab.x=0;
			//this.newTab.y=100;
			this.newTab.width=this.container_sprite.width;
			this.newTab.height=this.container_sprite.height;
			//this.newTab.setFocus();
			//var backImage:Image = 
			//this.newTab.icon= this.tabIcon;
			//this.addChildren();
			this.container_sprite.addChild(this.newTab);
			trace("New tab added to container");
		
		}
		
		public function setTabAppearance(infoObj_object:Object):void
		{
			this.newTab.label=infoObj_object.tabName.toString();
			this.newTab.setStyle("backgroundImage",infoObj_object.tabBackground);
			this.newTab.setStyle("backgroundSize","100%");
			this.newTab.setStyle("backgroundColor","haloGreen");
			
			this.newTab.setStyle("borderThicknessTop",NaN);
			this.newTab.setStyle("borderThicknessBottom",NaN);
			this.newTab.setStyle("borderThicknessLeft",NaN);
			this.newTab.setStyle("borderThicknessRight",NaN);
			this.newTab.setStyle("headerHeight",0);
			
			trace("newTab.x="+this.newTab.x+"  newTab.y="+this.newTab.y +"   newTab.width="+this.newTab.width+"   newTab.height="+this.newTab.height);
		}
		
		public function addChildren(displayObj:DisplayObject):void
		{
			//trace("tab children addition initiated");
			//for each(var displayObj:DisplayObject in this.children_array)
			//{
				this.newTab.addChild(displayObj);
		//	}
			trace(" tab children added ");
		}
		
		public function removeChild(displayObj:DisplayObject):void
		{
			this.newTab.removeChild(displayObj);
		}

	}
}